package ua.org.plast.mobileApp.songbook;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import ua.org.plast.mobileApp.App;
import ua.org.plast.mobileApp.R;
import ua.org.plast.mobileApp.fragments.BaseFragment;

/**
 * Created with IntelliJ IDEA.
 * User: Virus1908
 * Date: 13.11.13
 * Time: 21:42
 */
public class SongbookFragment extends BaseFragment {
    int count = 0;
    TextView mCount;

    @Override
    public String getActivityLabel() {
        return App.getContext().getResources().getString(R.string.nav_spivanyk);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View returnView = inflater.inflate(R.layout.songbook_fragment, null);
        mCount = (TextView) returnView.findViewById(R.id.count);
        mCount.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                mCount.setText(count++ + "");
            }
        });
        mCount.setOnLongClickListener(new View.OnLongClickListener() {
            @Override
            public boolean onLongClick(View view) {
                Bundle args = new Bundle();
                args.putInt("ololo", count);
                mMainActivity.showPopupFragment(SingleSongFragment.class, args);
                return true;
            }
        });
        return returnView;
    }
}
